
class ColorManage{

  _color = [
    '#39a0ff', '#fcd77c', '#36cbcb' , '#f5896d' , '#919de9' ,
    '#99c18c', '#dc69aa' , '#3eb07b', '#607d8b' , '#ced7dc'
  ];

  get color(){
    return this._color.concat(this.customColor);
  }

  customColor = [];

  index = 0;

  addColor(color){
    if(typeof color === 'string'){
      this.customColor.push(color);
    }
    if(typeof color === 'object'){
      this.customColor = this.customColor.concat(color);
    }
    return this;
  }

  random(){
    let color = this.color;
    return color[Math.floor(Math.random() * color.length)];
  }

}

export default new ColorManage;